package com.mqtt.web.controller.device;

import com.mqtt.common.core.domain.AjaxResult;
import com.mqtt.system.domain.Device;
import com.mqtt.system.domain.Nodes;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author wang
 * @version 1.0
 * @data 2024/5/9 下午 10:16
 * @desc 描述信息
 */
@RestController
@RequestMapping("/device")
public class deviceController {

    /**
     * 获取我的节点列表
     * @return
     */
    @GetMapping("/nodes/list")
    public AjaxResult myNodeList(){
        return null;
    }

    /**
     * 创建节点
     * @return
     */
    @PostMapping("/nodes/create")
    public AjaxResult nodeCreate(@RequestBody Nodes nodes){
        return null;
    }

    /**
     * 删除节点
     * @param map
     * @return
     */
    @PostMapping("/nodes/delete")
    public AjaxResult nodeDelete(@RequestBody Map<String,Long> map){
        Long id = map.get("id");
        return null;
    }
    /**
     * 更新节点
     * @return
     */
    @PostMapping("/nodes/update")
    public AjaxResult nodeUpdate(@RequestBody Nodes nodes){
        return null;
    }

    /**
     * 根据节点id查询设备
     * @param nodeId
     * @return
     */
    @GetMapping("/device/list")
    public AjaxResult myDeviceList(@RequestParam Long nodeId){
        return null;
    }

    /**
     * 在节点下创建设备
     * @param device
     * @return
     */
    @PostMapping("/device/create")
    public AjaxResult deviceCreate(@RequestBody Device device){
        return null;
    }

    @PostMapping("/device/delete")
    public AjaxResult deviceDelete(@RequestBody Map<String,Long> map){
        Long id = map.get("id");
        return null;
    }

    @PostMapping("/device/update")
    public AjaxResult deviceUpdate(@RequestBody Device device){
        return null;
    }

}
